<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .train1 {
            display: flex;
            background-color: aquamarine;
            justify-content: space-between;
            align-items: center;
        }

        .train2 input {
            width: 50px;
            height: 24px;

        }

        .train2 span {
            background: azure;
            width: 50px;
            height: 24px;
            text-align: center;
            line-height: 24px;
            background: white;
            text-align: center;
            line-height: 24px;

        }
    </style>

</head>


<body>
    <div class="train2">
        <input id="num1" type="number">
        <select id="opt">
            <option>+</option>
            <option>-</option>
            <option>*</option>
            <option>/</option>
            <option>%</option>
        </select>
        <input id="num2" type="number">
        <span class="d" onclick="count()"></span>
        <span id="res"></span>
    </div>

    <script>
        function count() {
            let num1 = document.getElementById("num1").value;
            let opt = document.getElementById("opt").value;
            let num2 = document.getElementById("num2").value;
            let res = eval(num1 + opt * num2); document.getElementById("res").innerText = res;

        }
    </script>

</body>

</html>